#include <Python.h>
#include <stdio.h>

#ifndef _WIN32
#ifdef __cplusplus
extern "C"
#endif
__attribute__((visibility("default"))) PyObject* PyInit__C(void);
#endif
static PyObject* module;


static PyObject* method_test() {
    printf("method_test =====>\n");
    return Py_True;
}

PyMODINIT_FUNC PyInit__C(void)
{
    printf("PyInit__C =====>\n");
    static PyMethodDef FtestMethods[] = {
        {"test", method_test, METH_VARARGS, "Python interface for test C library function"},
        {NULL, NULL, 0, NULL}
    };
    static struct PyModuleDef torchmodule = {
        PyModuleDef_HEAD_INIT, "torch._C", "Python interface for the test C library function", -1, FtestMethods};
    module = PyModule_Create(&torchmodule);
    return module;
}